<?php
 /**
 * Example Application

 * @package Example-application
 */

require 'config.php';

$smarty = new Smarty;
$result = mysql_query("select * from article where id = ".$_GET['id']."");
$row = mysql_fetch_array($result);
$smarty->assign('row',$row);

//获取文章评论
$comment = mysql_query("select * from comment where aid=".$_GET['id']." order by id desc");
while($list = mysql_fetch_array($comment)){
	 $arr[] = array("details"=>$list[details],"d_time"=>$list[d_time],"reply"=>$list[reply],"r_time"=>$list[r_time]);
}
$smarty->assign('per',$arr);

$smarty->force_compile = true;
//$smarty->debugging = true;
$smarty->caching = true;
$smarty->cache_lifetime = 120;
$smarty->display('article.tpl');

?>
